package spindles.gwt.shared;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class SettingsDTO extends DTO {
	
	private String exportDirectory;
	
	private boolean showOnlyRawData;
	
	private String defaultGroupName;
	
	private int plotWidth;
	
	private int plotHeight;
	
	/**	 
	 * @gwt.typeArgs <java.lang.String, java.lang.String>
	 */
	private Map thresholdGroups = new HashMap();
	
	
	public SettingsDTO(){}
	
	public List getThresholdGroups(){
		return new ArrayList(thresholdGroups.entrySet());
	}
	
	public Map getThresholdGroupsMap(){
		return new HashMap(thresholdGroups);
	}
	
	public void setThresholdGroups(Map groups){
		thresholdGroups.clear();
		thresholdGroups.putAll(groups);
	}

	public String[] toRecord() {		
		return null;
	}


	public String getExportDirectory() {
		return exportDirectory;
	}


	public void setExportDirectory(String exportDirectory) {
		this.exportDirectory = exportDirectory;
	}


	public boolean isShowOnlyRawData() {
		return showOnlyRawData;
	}


	public void setShowOnlyRawData(boolean showOnlyRawData) {
		this.showOnlyRawData = showOnlyRawData;
	}


	public void setDefaultGroupName(String defaultGroupName) {
		this.defaultGroupName = defaultGroupName;
	}
	
	public String getDefaultGroupName(){
		return this.defaultGroupName;
	}
	
	public String[] getDefaultGroup(){		
		String groupDescr = (String)thresholdGroups.get(defaultGroupName);
		
		return new String[]{defaultGroupName, groupDescr};
	}

	public int getPlotHeight() {
		return plotHeight;
	}

	public void setPlotHeight(int plotHeight) {
		this.plotHeight = plotHeight;
	}

	public int getPlotWidth() {
		return plotWidth;
	}

	public void setPlotWidth(int plotWidth) {
		this.plotWidth = plotWidth;
	}
	
	public String toString(){
		return "id=" + getId() +
		",defaultGroupName=" + defaultGroupName + 
		",exportDirectory=" + exportDirectory +
		",plotHeight=" + plotHeight +
		",plotWidth=" + plotWidth +
		",showOnlyRawData=" + showOnlyRawData;
	}
	
	

}
